code-snippets

Copy & paste the code snippets into your pages to quickly add interaction to each section

right click / inspect

Playing an Audio file onClick

this example loads an external audio file (interactive-examples.mdn.mozilla.net)

You could create your own sound file and load it directly from your application!

Or download an audio file from a license free source and load that directly from your application!

right-click & Open Image in New Tab

code snippet

Switching an image onClick

image

You could modify the function & show another image or rest to the first

right-click & Open Image in New Tab

code snippet

Getting a value from an input

Type a value into the field & press Enter

Remember your quiz game?

right-click & Open Image in New Tab

code snippet

These are just a few examples of what we have learned during the year - there are many other ways you could use that code to build the parts of your application.

Re-use existing code which is already working & modify it to a new purpose.

*This saves you time and reduces the chance of errors when hand typing.